package cn.com.api.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import cn.com.api.entity.ApiT_order;
import cn.com.api.entity.ApiU_coupon;
import cn.com.api.mapper.base.U_couponMapperBase;

//DAO
public interface ApiU_couponMapper extends U_couponMapperBase {

	// 新增对象后返回记录ID
	public int U_couponInsertion(ApiU_coupon u_coupon);

	// 根据查询条件查询结果集
	public List<ApiU_coupon> findU_couponsByCondition(Map<String, Object> param);

	// 修改
	@Update("UPDATE U_COUPON SET COUPON_CATE_ID = #{coupon_cate_id}, CORP_NAME = #{corp_name,jdbcType=VARCHAR}, "
			+ "CORP_ADRESS = #{corp_adress,jdbcType=VARCHAR}, RANGE = #{range,jdbcType=VARCHAR}, "
			+ "CORP_MOBILE = #{corp_mobile}, BUSINESS_HOURS = #{business_hours,jdbcType=VARCHAR}, COUPON_TYPE = #{coupon_type}, DESCRIPTION = #{description,jdbcType=VARCHAR}, "
			+ "DEPOSIT_AMOUNT = #{deposit_amount,jdbcType=VARCHAR}, DEPOSIT_STATUS = #{deposit_status}, "
			+ "COUPON_AMOUT = #{coupon_amout}, USE_LIMIT1 = #{use_limit1,jdbcType=VARCHAR}, COUPON_COUNT = #{coupon_count}, "
			+ "START_TIME = #{start_time,jdbcType=VARCHAR}, END_TIME = #{end_time,jdbcType=VARCHAR}, USER_ID = #{user_id}, "
			+ "PROVINCE = #{province,jdbcType=VARCHAR}, CITY = #{city,jdbcType=VARCHAR}, AREA = #{area,jdbcType=VARCHAR},  "
			+ "COUPON_PREFIX = #{coupon_prefix,jdbcType=VARCHAR}, COUPON_IMG = #{coupon_img,jdbcType=VARCHAR} WHERE COUPON_ID = #{coupon_id}")
	public int updateU_coupon_info(ApiU_coupon u_coupon);

	public int insertU_coupon_info(ApiU_coupon u_coupon);

	public List<ApiU_coupon> findU_couponsByUserid(Map<String, Object> params);

	public ApiU_coupon findU_couponsDetailByCouponid(Map<String, Object> params);

	public List<ApiU_coupon> findU_coupons_info(Map<String, Object> params);

	public List<Map<String, Object>> getOrdersList(@Param("map") Map<String, Object> param);

}
